import { useRef } from "react";
import { QueryPage } from "@components";
import { fields, GetColumns } from "./config";
import { findCfgSwitches, editCfgSwitch } from "@apis/autoConfigApi";

const AutoConfig = () => {

  const queryFormRef = useRef("queryFormRef");
  const formProps = {
    formRef: queryFormRef,
    fields: fields,
    initialValues: {
      switchStatus: "open"
    },
  };

  const tableProps = {
    rowKey: "unitCode",
    columns: GetColumns(),
  };

  return (
    <QueryPage
      formProps={formProps}
      tableProps={tableProps}
      showModal={false}
      queryApi={findCfgSwitches}
    />
  );
};

export default AutoConfig;
